package com.xxg.websocket;

import com.xxg.websocket.myclient.MyWebSocketClient;

import java.net.URI;
import java.net.URISyntaxException;

/**
 * @描述
 * @创建人 joy_qiu
 * @创建时间 2020-05-21-17:21
 * @修改人和其它信息
 */
public class MyTest {


    /**
     * @param
     * @return
     * @throws
     * @apiNote ***
     **/
    public static void main(String[] arg0) throws URISyntaxException {
        URI uri = URI.create("ws://localhost:8080/websocket");
        MyWebSocketClient myClient = new MyWebSocketClient(uri);
        myClient.connect();
        while (myClient.getReadyState() != null) {
            System.out.println("还没有打开");
        }
        // 往websocket服务端发送数据
        myClient.send("此为要发送的数据内容");
        myClient.close();
    }
}
